package com.fanix5.javamvvm.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class BannerBean implements Parcelable {
    @SerializedName("id")
    private int id;
    @SerializedName("title")
    private String title;
    @SerializedName("url")
    private String url;
    @SerializedName("sort")
    private int sort;
    @SerializedName("shopId")
    private int shopId;
    @SerializedName("extendId")
    private int extendId;
    @SerializedName("type")
    private int type;

    protected BannerBean(Parcel in) {
        id = in.readInt();
        title = in.readString();
        url = in.readString();
        sort = in.readInt();
        shopId = in.readInt();
        extendId = in.readInt();
        type = in.readInt();
    }

    public static final Creator<BannerBean> CREATOR = new Creator<BannerBean>() {
        @Override
        public BannerBean createFromParcel(Parcel in) {
            return new BannerBean(in);
        }

        @Override
        public BannerBean[] newArray(int size) {
            return new BannerBean[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(title);
        dest.writeString(url);
        dest.writeInt(sort);
        dest.writeInt(shopId);
        dest.writeInt(extendId);
        dest.writeInt(type);
    }
}
